﻿Imports System.Xml.Serialization
Imports KanBan.Pgd.Common

Namespace Resources

    <XmlType(AnonymousType:=True), _
     XmlRoot(ElementName:="permissions", [Namespace]:="", IsNullable:=False)> _
    Partial Public Class PermissionResource

        Private _permissions() As PermissionItem

        <XmlElement("permission", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property Permissions() As PermissionItem()
            Get
                Return _permissions
            End Get
            Set(ByVal value As PermissionItem())
                _permissions = value
            End Set
        End Property

        Public Shared Function GetResource() As PermissionResource
            Return XmlDeserializer(Of PermissionResource).Deserialize("Resources\Permissions.xml")
        End Function

    End Class

    <XmlType(AnonymousType:=True)> _
    Partial Public Class PermissionItem

        Private _id As String

        Private _name As String

        <XmlAttribute("id")> _
        Public Property Id() As String
            Get
                Return Me._id
            End Get
            Set(ByVal value As String)
                Me._id = value
            End Set
        End Property

        <XmlAttribute("name")> _
        Public Property Name() As String
            Get
                Return Me._name
            End Get
            Set(ByVal value As String)
                Me._name = value
            End Set
        End Property
    End Class

End Namespace
